home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-12-03 | 2.5 KB | 65 lines | [TEXT/MPS ] |
-
-
- CPlusTESample is a simple C++ text editing application. This sample demonstrates
- how a C++ program can be built for both 68K and PowerPC platforms. The makefile
- provided can build 68K, PowerPC and FAT (both 68K and PowerPC in one) versions.
-
- How to build:
- -------------
-
- By default, CPlusTESample.make builds debuggable CPlusTESample. Use:
-
- make -f CPlusTESample.make
-
- To build only the PowerPC version, use:
-
- make -f CPlusTESample.make CPlusTESample.ppc
-
- To build only the 68K version, use:
-
- make -f CPlusTESample.make CPlusTESample.68K
-
- To build a non-debug version of the above, add the option "-d SymOpt=off" as in:
-
- make -d SymOpt=off -f CPlusTESample.make CPlusTESample.ppc
-
- Use the option "-e" to force everything to be rebuilt.
-
- This version of CPlusTESample was derived from the 68K version. The 68K version
- was in multiple folders, here all of the sources are in a single folder for
- simplicity.
-
- A few changes were needed to make CPlusTESample work with both the 68K and PowerPC:
-
- * The Universal headers shipped with the Macintosh on RISC Tools were used for
- both 68K and PowerPC builds.
-
- * The main change was the use of UniversalProcPointers instead of function
- pointers in a few places. You can find these in the code by searching for "upp".
-
- * The assembler glue routine, "ASMCLICKLoop" was eliminated in the PowerPC version.
- Taking advantage of the glue that MixedMode provides, this routine was rewritten
- in C.
-
- * The makefile was re-written.
-
- Implementation Details:
- ----------------------
-
- There are four main classes in this program. Each of these classes has a
- definition (.h) file and an implementation (.cp) file.
-
- The TApplication class does all of the basic event handling and initialization
- necessary for Mac Toolbox applications. It maintains a list of TEcocument
- objects, and passes events to the correct TEDocument class when apropriate.
-
- The TEDocument class does all of the basic document handling work. TEDocuments
- are objects that are associated with a window. Methods are provided to deal
- with update, activate, mouse-click, key down, and other events. Some additional
- classes which implement a linked list of TEDocument objects are provided.
-
- The TApplication and TEDocument classes together define a basic framework for
- Mac applications, without having any specific knowbedge about the type of data
- being displayed by the application's documents. They are a (very) crude
- implementation of the MacApp application model, without the sophisticated view
- heirarchies or any real error handling.